home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / math / alged34.zip / ALGED.DOC < prev    next >
Text File  |  1996-06-06  |  13KB  |  280 lines

  1. Tutorial for Algebra Editor           John Henckel, henckel@vnet.ibm.com
  2.  
  3. Copyright (c) 1994,1996 John Henckel
  4. Permission to use, copy, modify, distribute and sell this software
  5. and its documentation for any purpose is hereby granted without fee,
  6. provided that the above copyright notice appear in all copies and
  7. that both that copyright notice and this permission notice appear
  8. in supporting documentation.  All programs contained herein are provided
  9. to you "as is".  The implied warranties of merchantability and fitness
  10. for a particular purpose are expressly disclaimed.
  11.  
  12. Getting Started
  13. ---------------
  14. By now I assume you have downloaded the alged33.zip and unzipped it.  You
  15. should have the following files...
  16.  
  17.     setup.bat      <--- run this to change language and video
  18.     alged.exe      <--- the program
  19.     alged.ae       <--- sample data file
  20.     alged.1st      <--- user options file
  21.     alged.doc      <--- tutorial (this file)
  22.     algedeng.hlp   <--- online help
  23.     algedeng.hlq   <--- online help (graphics mode)
  24.     algedeng.mnu   <--- menu, text and keyboard definitions
  25.     svga.ae        <--- Super VGA 256 color option file
  26.     ned.ae         <--- Flemish option file
  27.     fra.ae         <--- French option file
  28.     algedned.*     <--- Flemish language data
  29.     algedfra.*     <--- French language data
  30.     algedsrc.zip   <--- source code
  31.     file_id.diz    <--- short description
  32.     vgaprtsc.*     <--- TSR print screen utility for 16 color VGA graphics
  33.     *.bgi          <--- various graphics drivers (Borland)
  34.     jhenck*.gif    <--- some pictures of me
  35.  
  36. ===> If you prefer Flemish (Dutch) see the file algedned.doc. <===
  37.  
  38. The default language of the Alged program is English and
  39. the default graphics mode is "autodetect" up to 16 colors.
  40. To change the defaults, type
  41.  
  42.     setup
  43.  
  44. Before you run the Alged program, you might want to change the number of lines
  45. on the screen.  You can set this using the DOS command
  46.  
  47.     MODE co80,43
  48.  
  49. When you start Alged you may specify one or more data files or option files.
  50. The data file is just a text file you create with a text editor.  Start Alged
  51. with the sample data file...
  52.  
  53.     alged alged
  54.  
  55. You can use option files SVGA, NED, and FRA to change the language or graphics
  56. mode temporarily.  For example.
  57.  
  58.     alged alged svga
  59.  
  60. Now you should see a screen with a menu on the top and some formulas in the
  61. middle.  The first thing to learn is how to see the help text.  Press F1.
  62. The first part is a brief intro and how to use the mouse.  Then you see a
  63. description of each menu item.  Notice that each menu item has a hotkey.
  64.  
  65. Graphics
  66. --------
  67.  
  68. I know you all like graphics, so let's begin with some pretty pictures.
  69. The first formula you see is the following...
  70.  
  71.                                 2         2
  72.                         cos(x*2) *cos(y*2)  + r*0.2
  73.  
  74. What kind of function is this?  What does it look like?  A graph can help
  75. you quickly understand the properties of a function.  Click on Graph or
  76. press 'g' to graph this in two dimensions.  You see a cosine wave.  This is
  77. a cross-section of the function for values of x (because it is the first
  78. variable in the function).  To graph the other variables press 'V' (hold shift
  79. key).
  80.  
  81. The curve is rather jagged, so press [home] twice to add more points.  This
  82. draws the function slower but smoother.  Press [end] to remove points.
  83. You can press [ins] and [del] to zoom in or out.  You can press [pgup] and
  84. [pgdn] to stretch the function.  You can pan with the arrows.  You can press
  85. 'd' to return to the default view.
  86.  
  87. 3D graphics
  88. -----------
  89.  
  90. Now let's look at a 3-dimensional graph.  Press 'g' again.  You may need to
  91. press [home] or [end] to get a good picture.  Press [ins] one time to get
  92. closer.  You can see that this is a function like many mountains in straight
  93. rows.  Initially, the x-axis is pointing towards you, z points to the right
  94. and y points up.  If you have a color display, press 'c'.  Press 'f' to fill
  95. the graph.  Press 'f' again for a partially filled graph.  Press 'c' again to
  96. color the graph according the slope of the function, (see the ?r user option
  97. for the slope direction vector).
  98.  
  99. If you are using SVGA mode with 256 colors here are some treats for you.
  100. You can press 'x' to use a 240 color rainbow or 240 gray scale.  You can use
  101. the '-' and '=' key to cycle the palette.  Press them multiple times to cycle
  102. faster.  The 'z' key will scale the palette according to the range of the
  103. function so that all the colors are visible.  To view a shaded 3D graph, go to
  104. 3D mode and press 'dfxxcc' and press [home] to add points.
  105.  
  106. What would happen if you wrap this mountain function over a sphere?  Press
  107. 'a' to change to polar coordinates.  You may want to press [ins] to get
  108. closer.  The tick marks on the axes are units.  In polar mode, the x variable
  109. determines the latitude, and y determines the longitude.  The function value
  110. is the radius.  What about the other variable 'r'?  It is a free variable
  111. initially set to zero, (see upper left screen).  You can change the value
  112. of r by pressing 'w' and '2'.  What happens when r is 3? when r is -13?
  113.  
  114. Press F1 while in graphics mode to see more help about graphics keys (or look
  115. at the source code in algraph.c).
  116.  
  117. Parametric graphs
  118. -----------------
  119.  
  120. Press Esc to return to the main menu.  Now let's see a graph of a parametric
  121. function.  The next formula in the file is
  122.  
  123.                  cos(2*t) + sin(3*t + 0.2*u)
  124.  
  125. This formula describes the sound wave of a perfect fifth in music.  Press down
  126. arrow or click on the first '+' to select the formula, and press 'g' to graph
  127. it.  You can press 'w' and '2' to see the various phases.
  128.  
  129. What would happen if we plot the two components of this wave against each other
  130. on the x and y axes?  Press Esc to return to the main menu.  Click on the sin
  131. function with the left mouse button and click the cos function with the right
  132. mouse button.  (If you don't have a mouse, then press end, period, pgup, pgdn).
  133. The cos function is copied to the "key" at the bottom of the screen.  The key
  134. is used as the x axis function.  Press 'g' to view the graph, you should see
  135. the shape of a fish.  (If you don't see the fish press 'd' or 'a').  Now
  136. change the phase of the sine and see the effect.
  137.  
  138. Parametric graphs can also be useful in 3D.  The equation in the key is used
  139. to warp or even overlap the x coordinates.  You might try to put x + sin(y)
  140. in the key and then select and view the "mountains" function again.
  141.  
  142. Entering Formulas
  143. -----------------
  144.  
  145. Press Esc to return to the Alged main menu.  To enter your own formula into
  146. Alged, click on EnterKey or press 'k'.  Type a formula at the prompt, for
  147. example type...
  148.  
  149.     x + sin(y)
  150.  
  151. then press F6 (or ctrl-Z) and press Enter.  The formula appears at the bottom
  152. of the screen in the "key".  To move the key to the work space, click InsKey
  153. or press 'Ins', and press Enter.
  154.  
  155. When you are entering formulas, you can use the following keys
  156.         arrows = redo and undo a character
  157.         Insert = toggle insert mode
  158.         Delete = delete one character
  159.  
  160. The Alged formulas are stored in plain text files, so you can use any text
  161. editor to change or add formulas.
  162.  
  163. Solving Equations
  164. -----------------
  165.  
  166. Let's start with the next sample formula.
  167.  
  168.                      x*(5 + 2*x) - 2
  169.                     ----------------- - 2*x + 1 = 13
  170.                           3 + x
  171.  
  172. (It looks prettier than this if you use 8-bit ascii.)  To solve this
  173. problem, you need to find a common denominator for the left hand side.
  174. You can either click on the "Comm Deno" menu item or press the hotkey 'm'.
  175. The result is...
  176.  
  177.              x*(5 + 2*x) - 2 - 2*x*(3 + x) + 1*(3 + x)
  178.             ------------------------------------------- = 13
  179.                                3 + x
  180.  
  181. To complete the problem do the following
  182.  1. click on Distribute or press 'd'
  183.  2. click on Simplify or press space
  184.  3. click on EquLeft or press '[' to move the 1 across the equal
  185.  4. click on EquRight or press ']' to move the 3 across the equal
  186.  5. click on Simplify or press space. You should see  x = -2.92307692307692
  187.  6. click on Integer or press 'i' to convert to integer expression.
  188. The answer is -38/13.
  189.  
  190. You may be thinking "that was a lot of trouble to just solve for x" and you
  191. are right.  Mathematica can do it in one step.  But Alged is intentionally
  192. this way.  Rather than a long list of complicated transformations, Alged
  193. provides and short list of simple commands and a highly interactive user
  194. interface.  This is conducive to "playing" with the formulas creatively.
  195.  
  196. The next problem is to find the intersection of a parabola and a circle.
  197. In general, the solution would involve finding roots to a fourth degree
  198. polynomial.  This can be done, in theory, but for this tutorial we'll simplify
  199. the problem by constraining two of the roots.  Given a circle at the origin of
  200. radius r, and given a parabola that passes through the circle at (r,0) and
  201. (-r,0), at what other points does the parabola intersect the circle?  The
  202. equation of the circle is given by
  203.  
  204.                 2    2    2
  205.       (1)      x  + y  = r
  206.  
  207. The general form of the parabola is given by
  208.  
  209.                      / 2    2\
  210.       (2)      y = a*\r  - x /
  211.  
  212. To solve this we can eliminate y from (1) by substitution as follows
  213.  1. copy (2) to the Key by clicking on = with the right mouse button or
  214.     select it and press '.'.
  215.  2. select (1) by clicking on = with the left mouse button.
  216.  3. click on Substitut or press 'u'.
  217.  
  218. Subtract r^2 from both sides of (1) and simplify as follows
  219.  1. copy r^2 to the Key by clicking just ABOVE the r with the right mouse
  220.     button.  If you don't have a mouse: pgdn, period, pgup.
  221.  2. click on Subtr Key or press '-'.
  222.  3. click on ^N Expand or press 'n'.
  223.  4. click on Distribut or press 'd'.
  224.  5. click on Simplify or press ' '.
  225.  
  226. Now we have a fourth degree polynomial.  We know two of the roots: r, -r.  So
  227. we can reduce the equation by polynomial division.
  228.  1. copy (r^2 - x^2) to the key by clicking on the minus sign in (2) with
  229.     the right mouse button.  Keyboard: down, pgdn, pgdn, period, up.
  230.  2. click on Div Key or press '/'.
  231.  3. press Enter to erase the key.
  232.  4. click on Poly Div or press '\'.
  233.  
  234. Now you should see the quotient plus the remainder fraction.  In this case
  235. the remainder reduces to zero after you distribute and simplify.
  236.  1. click on Distribut or press 'd'.
  237.  2. click on Simplify or press ' '.
  238.  
  239. Since the quotient is a second degree polynomial, we can solve it with the
  240. quadratic equation.
  241.  1. click on FactQuad or press 'q'.
  242.  2. click on Simplify or press ' '.
  243.  3. Press shift 'D' to distribute each factor.  (if you press 'd' you would
  244.     essentially undo the factorization).
  245.  4. click on Calculate or press 'c'.
  246.  5. click on Simplify or press ' '.
  247.  
  248. From the factored form of the polynomial you can see there are two roots.
  249. To solve for one of them press EquRight, EquLeft, EquLeft (']' '[' '[') and
  250. Simplify.
  251.                                    0.5
  252.                         / 2  2    \
  253.                         \a *r  - 1/
  254.                    x = ----------------
  255.                               a
  256.  
  257. The next little formula just demonstrates some arithmetic with complex numbers.
  258. Select it and press 'c' to calculate.  Both sides should be equal.
  259.  
  260. The remainder of the alged.ae file contains some sample problems for you to
  261. play with.  The last set of equations is the basis of another program I wrote
  262. called Impact (available in http://www.coast.net/SimTel/msdos/simulatn.html).
  263. Wrestling with these equations for several hours inspired be to write Alged.
  264.  
  265. If you enjoy Alged or have any suggestions, please send me an email.
  266. I do not want you to send me any money, but I like to get mail.
  267.  
  268.  "But because of his great love for us, God, who is rich in mercy, made us
  269.   alive with Christ even when we were dead in transgressions -- it is by
  270.   grace you have been saved.  And God raise us up with Christ and seated us
  271.   with him in the heavenly realms in Christ Jesus, in order that in the coming
  272.   ages he might show the incomparable riches of his grace, expressed in his
  273.   kindness to us in Christ Jesus.  For it is by grace you have been saved,
  274.   through faith -- and this not of yourselves, it is the gift of God -- not by
  275.   works, so that no one can boast.  For we are God's workmanship, created in
  276.   Christ Jesus to do good works, which God prepared in advance for us to do."
  277.   Ephesians 2.4-10 NIV
  278.  
  279. John Henckel       henckel@vnet.ibm.com
  280.